\(\int \cos ^3(c+d x) (a+i a \tan (c+d x))^3 \, dx\) [48]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [A] (verified)
   Fricas [A] (verification not implemented)
   Sympy [A] (verification not implemented)
   Maxima [B] (verification not implemented)
   Giac [B] (verification not implemented)
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 24, antiderivative size = 32 \[ \int \cos ^3(c+d x) (a+i a \tan (c+d x))^3 \, dx=-\frac {i \cos ^3(c+d x) (a+i a \tan (c+d x))^3}{3 d} \]

[Out]

-1/3*I*cos(d*x+c)^3*(a+I*a*tan(d*x+c))^3/d

Rubi [A] (verified)

Time = 0.05 (sec) , antiderivative size = 32, normalized size of antiderivative = 1.00, number of steps used = 1, number of rules used = 1, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.042, Rules used = {3569} \[ \int \cos ^3(c+d x) (a+i a \tan (c+d x))^3 \, dx=-\frac {i \cos ^3(c+d x) (a+i a \tan (c+d x))^3}{3 d} \]

[In]

Int[Cos[c + d*x]^3*(a + I*a*Tan[c + d*x])^3,x]

[Out]

((-1/3*I)*Cos[c + d*x]^3*(a + I*a*Tan[c + d*x])^3)/d

Rule 3569

Int[((d_.)*sec[(e_.) + (f_.)*(x_)])^(m_.)*((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(n_), x_Symbol] :> Simp[b*(d*
Sec[e + f*x])^m*((a + b*Tan[e + f*x])^n/(a*f*m)), x] /; FreeQ[{a, b, d, e, f, m, n}, x] && EqQ[a^2 + b^2, 0] &
& EqQ[Simplify[m + n], 0]

Rubi steps \begin{align*} \text {integral}& = -\frac {i \cos ^3(c+d x) (a+i a \tan (c+d x))^3}{3 d} \\ \end{align*}

Mathematica [A] (verified)

Time = 0.19 (sec) , antiderivative size = 31, normalized size of antiderivative = 0.97 \[ \int \cos ^3(c+d x) (a+i a \tan (c+d x))^3 \, dx=-\frac {i a^3 (\cos (c+d x)+i \sin (c+d x))^3}{3 d} \]

[In]

Integrate[Cos[c + d*x]^3*(a + I*a*Tan[c + d*x])^3,x]

[Out]

((-1/3*I)*a^3*(Cos[c + d*x] + I*Sin[c + d*x])^3)/d

Maple [A] (verified)

Time = 6.81 (sec) , antiderivative size = 19, normalized size of antiderivative = 0.59

method result size
risch \(-\frac {i a^{3} {\mathrm e}^{3 i \left (d x +c \right )}}{3 d}\) \(19\)
derivativedivides \(\frac {\frac {i a^{3} \left (2+\sin ^{2}\left (d x +c \right )\right ) \cos \left (d x +c \right )}{3}-a^{3} \left (\sin ^{3}\left (d x +c \right )\right )-i a^{3} \left (\cos ^{3}\left (d x +c \right )\right )+\frac {a^{3} \left (2+\cos ^{2}\left (d x +c \right )\right ) \sin \left (d x +c \right )}{3}}{d}\) \(76\)
default \(\frac {\frac {i a^{3} \left (2+\sin ^{2}\left (d x +c \right )\right ) \cos \left (d x +c \right )}{3}-a^{3} \left (\sin ^{3}\left (d x +c \right )\right )-i a^{3} \left (\cos ^{3}\left (d x +c \right )\right )+\frac {a^{3} \left (2+\cos ^{2}\left (d x +c \right )\right ) \sin \left (d x +c \right )}{3}}{d}\) \(76\)

[In]

int(cos(d*x+c)^3*(a+I*a*tan(d*x+c))^3,x,method=_RETURNVERBOSE)

[Out]

-1/3*I/d*a^3*exp(3*I*(d*x+c))

Fricas [A] (verification not implemented)

none

Time = 0.23 (sec) , antiderivative size = 17, normalized size of antiderivative = 0.53 \[ \int \cos ^3(c+d x) (a+i a \tan (c+d x))^3 \, dx=-\frac {i \, a^{3} e^{\left (3 i \, d x + 3 i \, c\right )}}{3 \, d} \]

[In]

integrate(cos(d*x+c)^3*(a+I*a*tan(d*x+c))^3,x, algorithm="fricas")

[Out]

-1/3*I*a^3*e^(3*I*d*x + 3*I*c)/d

Sympy [A] (verification not implemented)

Time = 0.13 (sec) , antiderivative size = 36, normalized size of antiderivative = 1.12 \[ \int \cos ^3(c+d x) (a+i a \tan (c+d x))^3 \, dx=\begin {cases} - \frac {i a^{3} e^{3 i c} e^{3 i d x}}{3 d} & \text {for}\: d \neq 0 \\a^{3} x e^{3 i c} & \text {otherwise} \end {cases} \]

[In]

integrate(cos(d*x+c)**3*(a+I*a*tan(d*x+c))**3,x)

[Out]

Piecewise((-I*a**3*exp(3*I*c)*exp(3*I*d*x)/(3*d), Ne(d, 0)), (a**3*x*exp(3*I*c), True))

Maxima [B] (verification not implemented)

Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 75 vs. \(2 (26) = 52\).

Time = 0.31 (sec) , antiderivative size = 75, normalized size of antiderivative = 2.34 \[ \int \cos ^3(c+d x) (a+i a \tan (c+d x))^3 \, dx=-\frac {3 i \, a^{3} \cos \left (d x + c\right )^{3} + 3 \, a^{3} \sin \left (d x + c\right )^{3} + i \, {\left (\cos \left (d x + c\right )^{3} - 3 \, \cos \left (d x + c\right )\right )} a^{3} + {\left (\sin \left (d x + c\right )^{3} - 3 \, \sin \left (d x + c\right )\right )} a^{3}}{3 \, d} \]

[In]

integrate(cos(d*x+c)^3*(a+I*a*tan(d*x+c))^3,x, algorithm="maxima")

[Out]

-1/3*(3*I*a^3*cos(d*x + c)^3 + 3*a^3*sin(d*x + c)^3 + I*(cos(d*x + c)^3 - 3*cos(d*x + c))*a^3 + (sin(d*x + c)^
3 - 3*sin(d*x + c))*a^3)/d

Giac [B] (verification not implemented)

Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 901 vs. \(2 (26) = 52\).

Time = 0.71 (sec) , antiderivative size = 901, normalized size of antiderivative = 28.16 \[ \int \cos ^3(c+d x) (a+i a \tan (c+d x))^3 \, dx=\text {Too large to display} \]

[In]

integrate(cos(d*x+c)^3*(a+I*a*tan(d*x+c))^3,x, algorithm="giac")

[Out]

-1/384*(108*a^3*e^(8*I*d*x + 4*I*c)*log(I*e^(I*d*x + I*c) + 1) + 432*a^3*e^(6*I*d*x + 2*I*c)*log(I*e^(I*d*x +
I*c) + 1) + 432*a^3*e^(2*I*d*x - 2*I*c)*log(I*e^(I*d*x + I*c) + 1) + 648*a^3*e^(4*I*d*x)*log(I*e^(I*d*x + I*c)
 + 1) + 108*a^3*e^(-4*I*c)*log(I*e^(I*d*x + I*c) + 1) + 111*a^3*e^(8*I*d*x + 4*I*c)*log(I*e^(I*d*x + I*c) - 1)
 + 444*a^3*e^(6*I*d*x + 2*I*c)*log(I*e^(I*d*x + I*c) - 1) + 444*a^3*e^(2*I*d*x - 2*I*c)*log(I*e^(I*d*x + I*c)
- 1) + 666*a^3*e^(4*I*d*x)*log(I*e^(I*d*x + I*c) - 1) + 111*a^3*e^(-4*I*c)*log(I*e^(I*d*x + I*c) - 1) - 108*a^
3*e^(8*I*d*x + 4*I*c)*log(-I*e^(I*d*x + I*c) + 1) - 432*a^3*e^(6*I*d*x + 2*I*c)*log(-I*e^(I*d*x + I*c) + 1) -
432*a^3*e^(2*I*d*x - 2*I*c)*log(-I*e^(I*d*x + I*c) + 1) - 648*a^3*e^(4*I*d*x)*log(-I*e^(I*d*x + I*c) + 1) - 10
8*a^3*e^(-4*I*c)*log(-I*e^(I*d*x + I*c) + 1) - 111*a^3*e^(8*I*d*x + 4*I*c)*log(-I*e^(I*d*x + I*c) - 1) - 444*a
^3*e^(6*I*d*x + 2*I*c)*log(-I*e^(I*d*x + I*c) - 1) - 444*a^3*e^(2*I*d*x - 2*I*c)*log(-I*e^(I*d*x + I*c) - 1) -
 666*a^3*e^(4*I*d*x)*log(-I*e^(I*d*x + I*c) - 1) - 111*a^3*e^(-4*I*c)*log(-I*e^(I*d*x + I*c) - 1) + 3*a^3*e^(8
*I*d*x + 4*I*c)*log(I*e^(I*d*x) + e^(-I*c)) + 12*a^3*e^(6*I*d*x + 2*I*c)*log(I*e^(I*d*x) + e^(-I*c)) + 12*a^3*
e^(2*I*d*x - 2*I*c)*log(I*e^(I*d*x) + e^(-I*c)) + 18*a^3*e^(4*I*d*x)*log(I*e^(I*d*x) + e^(-I*c)) + 3*a^3*e^(-4
*I*c)*log(I*e^(I*d*x) + e^(-I*c)) - 3*a^3*e^(8*I*d*x + 4*I*c)*log(-I*e^(I*d*x) + e^(-I*c)) - 12*a^3*e^(6*I*d*x
 + 2*I*c)*log(-I*e^(I*d*x) + e^(-I*c)) - 12*a^3*e^(2*I*d*x - 2*I*c)*log(-I*e^(I*d*x) + e^(-I*c)) - 18*a^3*e^(4
*I*d*x)*log(-I*e^(I*d*x) + e^(-I*c)) - 3*a^3*e^(-4*I*c)*log(-I*e^(I*d*x) + e^(-I*c)) + 128*I*a^3*e^(11*I*d*x +
 7*I*c) + 512*I*a^3*e^(9*I*d*x + 5*I*c) + 768*I*a^3*e^(7*I*d*x + 3*I*c) + 512*I*a^3*e^(5*I*d*x + I*c) + 128*I*
a^3*e^(3*I*d*x - I*c))/(d*e^(8*I*d*x + 4*I*c) + 4*d*e^(6*I*d*x + 2*I*c) + 4*d*e^(2*I*d*x - 2*I*c) + 6*d*e^(4*I
*d*x) + d*e^(-4*I*c))

Mupad [B] (verification not implemented)

Time = 3.98 (sec) , antiderivative size = 66, normalized size of antiderivative = 2.06 \[ \int \cos ^3(c+d x) (a+i a \tan (c+d x))^3 \, dx=-\frac {2\,a^3\,\left (3\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2-1\right )}{3\,d\,\left (-{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3-{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2\,3{}\mathrm {i}+3\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )+1{}\mathrm {i}\right )} \]

[In]

int(cos(c + d*x)^3*(a + a*tan(c + d*x)*1i)^3,x)

[Out]

-(2*a^3*(3*tan(c/2 + (d*x)/2)^2 - 1))/(3*d*(3*tan(c/2 + (d*x)/2) - tan(c/2 + (d*x)/2)^2*3i - tan(c/2 + (d*x)/2
)^3 + 1i))